using System;
using DotNetNuke;
using System.Data;

using DotNetNuke.Framework;

namespace SmallAdvert
{
    public abstract class DataProvider
    {

    #region Shared/Static Methods

        // singleton reference to the instantiated object 
        static DataProvider  objProvider = null;

        // constructor
        static DataProvider()
        {
            CreateProvider();
        }

        // dynamically create provider
        private static void CreateProvider()
        {
            objProvider = (DataProvider)Reflection.CreateObject("data", "SmallAdvert", "");
        }

        // return the provider
        public static  DataProvider Instance() 
        {
            return objProvider;
        }

    #endregion
        #region "tm_small_advert Abstract Methods"
        public abstract IDataReader Gettm_small_advert(int advertId);
        public abstract IDataReader Listtm_small_advert();
        public abstract IDataReader Gettm_small_advertBytm_users(int userId);
        public abstract int Addtm_small_advert(string subject, string contents, DateTime openDate, DateTime closeDate, DateTime createDate, int createBy, string status, int editBy);
        public abstract void Updatetm_small_advert(int advertId, string subject, string contents, DateTime openDate, DateTime closeDate, DateTime createDate, int createBy, string status, int editBy);
        public abstract void Deletetm_small_advert(int advertId);
        #endregion
    }
}
